<#
to start powershell script:
PowerShell -ExecutionPolicy Bypass .\mouse_pos.ps1
#>

function watch_mouse(){
	[System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
	cls
	$oX = 0

	while(1)
	{
	Start-Sleep -m 500     
	$mY = ([System.Windows.Forms.Cursor]::Position.Y )#Mouse Y
	$mX = ([System.Windows.Forms.Cursor]::Position.X )#Mouse X 
	Write-Host $mX,$mY    
	
		if(($oX -ne $mX) -and ($oX -ne 0))
		{
			Write-Host "Mouse Moved on X!"
			break
		}
		
		$oX = $mX
		
	}
}

watch_mouse